package create_创建型.abstract_factory_pattern_抽象工厂模式;

/**
 * Created with IntelliJ IDEA.
 *
 * @Auther: hihi
 * @Date: 2020/07/03/14:58
 * @Description:
 */
public class AbstractFactoryPatternDemo {
	public static void main(String[] args) {

		//获取形状工厂
		AbstractFactory shapeFactory = FactoryProducer.getFactory("shape");
		//获取形状
		Shape circle = shapeFactory.getShape("circle");
		//形状执行
		circle.draw();

		//获取颜色工厂
		AbstractFactory colorFactory = FactoryProducer.getFactory("color");
		//获取颜色
		Color red = colorFactory.getColor("red");
		//颜色执行
		red.fill();

	}
}
